﻿@using Model.Util.DTO;
@using Xproject.Util;
@using Model.Util.Enum;
@{
    Layout = "~/Views/Shared/_JSlayout.cshtml";
    string Domain = CommonHelper.GetAppSettings("Domin");

}
@model AttributeGroupModel

<title>添加商品分类</title>
<link href="~/Content/categoryCss/site.css" rel="stylesheet" />
<script type="text/javascript">
    $(document).ready(function () {
        var optionsNew = {
            beforeSubmit: function () {
                //layer.open({ type: 2, time: 2 });
                layer.load(1, { shade: [0.1, '#000'], time: 2000 });
            },
            success: function (data) {
                if (data.Success == true) {
                    layer.alert('编辑成功', { icon: 1, skin: 'layer-ext-moon', time: 2000 });
                } else {
                    layer.alert(data.Data, { icon: 1, skin: 'layer-ext-moon', time: 2000 });
                }
            },
            error: function () {
                alert(JSON.stringify(data));
            },
            type: "post",
            clearForm: false,
            timeout: 100000
        };

        $("#AttributeGroup").submit(function () {
            $("#AttributeGroup").ajaxSubmit(optionsNew);// type="button"
            return false;
        });
    });


</script>
<h1 class="rightH1">
    分组管理 &gt;&gt; 添加分组
    <div class="right">
        <a href="@(Domain)/Category/AttributeGroupList?cateId= @ViewData["cateId"]" class="menuBT">
            <img src="../../content/images/goback.jpg" />返回列表
        </a>
        <div class="clear">
        </div>
    </div>
    <div class="clear">
    </div>
</h1>
<form class="form-horizontal m-t" id="AttributeGroup" action="~/Category/AddAttributeGroup" method="post">
    <div class="addTable">

        <table width="100%">
            <tr>
                <td width="76px" align="right">
                    所属分类：
                </td>
                <td>
                    <input type="hidden" name="CateId" value="@ViewData["cateId"]" />
                    <input type="text" name="CategoryName" disabled="disabled" size="35" class="input" value="@ViewData["categoryName"]" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    分组名称：
                </td>
                <td>
                    <input class="form-control" name="AttributeGroupName" value="@(Model!=null?Model.AttributeGroupName:"")" required />
                </td>
            </tr>
            <tr>
                <td align="right">
                    分组类别：
                </td>
                <td>
                    <select class="form-control" name="CategoryType">
                        @foreach (Enum_CategoryType type in Enum.GetValues(typeof(Enum_CategoryType)))
                        {
                        <option value="@((int)type)" @(Model!=null?((Model.CategoryType==(int)type)?"selected":""):"")>@Enum.GetName(typeof(Enum_CategoryType), type)</option>
                        }
                    </select>
                </td>
            </tr>
            <tr>
                <td align="right">
                    排序：
                </td>
                <td>
                    <input class="form-control" name="DisplayOrder" value="@(Model!=null?Model.DisplayOrder:0)" required />
                </td>
            </tr>
            <tr>
                <td align="right">
                    &nbsp;
                </td>
                <td>
                    <button type="submit" href="" class="addBt" id="sumbitBut">
                        <img src="../../content/images/submit.jpg" />
                    </button>

                </td>
            </tr>
            <tr>
                <td align="right">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
</form>
